//
// File: cat.cpp
//
// MATLAB Coder version            : 5.4
// C/C++ source code generated on  : 27-Mar-2025 11:51:36
//

// Include Files
#include "cat.h"
#include "rt_nonfinite.h"
#include "coder_array.h"

// Function Definitions
//
// Arguments    : coder::array<double, 2U> &in1
//                const coder::array<double, 2U> &in2
//                const coder::array<double, 2U> &in3
// Return Type  : void
//
void binary_expand_op(coder::array<double, 2U> &in1,
                      const coder::array<double, 2U> &in2,
                      const coder::array<double, 2U> &in3)
{
  coder::array<double, 1U> b_in2;
  int b_loop_ub;
  int i;
  int loop_ub;
  int stride_1_0;
  i = in2.size(0);
  loop_ub = in3.size(0);
  if (loop_ub == 1) {
    b_loop_ub = i;
  } else {
    b_loop_ub = loop_ub;
  }
  b_in2.set_size(b_loop_ub);
  b_loop_ub = (i != 1);
  stride_1_0 = (loop_ub != 1);
  if (loop_ub == 1) {
    loop_ub = i;
  }
  for (i = 0; i < loop_ub; i++) {
    b_in2[i] =
        in2[i * b_loop_ub + in2.size(0)] - in3[i * stride_1_0 + in3.size(0)];
  }
  loop_ub = in2.size(0);
  in1.set_size(loop_ub, 2);
  for (i = 0; i < loop_ub; i++) {
    in1[i] = in2[i];
  }
  loop_ub = b_in2.size(0);
  for (i = 0; i < loop_ub; i++) {
    in1[i + in1.size(0)] = b_in2[i];
  }
}

//
// File trailer for cat.cpp
//
// [EOF]
//
